import request from "@/api";

// 分页查询列表
export function listPage(params) {
  return request({
    url: "/role/listPage",
    method: "get",
    params: params,
  });
}

// 保存
export function save(data) {
  return request({
    url: "/role/save",
    method: "post",
    data: data,
  });
}

// 根据id获取详情
export function getById(id) {
  return request({
    url: "/role/getById",
    method: "get",
    params: {
      id: id,
    },
  });
}

// 删除
export function deleteById(id) {
  return request({
    url: "/role/deleteById",
    method: "delete",
    params: {
      id: id,
    },
  });
}

// 修改状态
export function changeRoleStatus(id, status) {
  return request({
    url: "/role/changeStatus",
    method: "post",
    params: {
      id: id,
      status: status,
    },
  });
}

// 获取全部角色
export function getRoleList() {
  return request({
    url: "/role/getRoleList",
    method: "get",
  });
}